<script>
    class God {
        constructor(name, weapon){
            this.name = name
            this.weapon = weapon
        }

        getName(){
            console.log(`${this.name}来也`);
            
        }

        setName(newName){
            this.name = newName
        }
    }

    let Monkey = new God('俺老孙','如意金箍棒')
    Monkey.getName()
    console.log(Monkey.name);
    Monkey.setName('齐天大圣')
    console.log(Monkey.name);
    
</script>